import request from '/@/utils/request';

/**
 * 安装/跟新 租户
 * @param params
 */
export function installTenant(params: any) {
    return request({
        url: '/plat/tenantInstall/build',
        method: 'post',
        data: params,
    });
}

/**
 * 安装/跟新 租户 并 立即发布
 * @param params
 */
export function installTenantAndPush(params: any) {
    return request({
        url: '/plat/tenantInstall/buildAndPublish',
        method: 'post',
        data: params,
    });
}

/**
 * 获取租户安装的资源
 * @param params
 */
export function buildTenantResources(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/resources`,
        method: 'get',
    });
}


/**
 * 获取租户安装的小程序
 * @param params
 */
export function buildTenantMiniapp(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/miniApps`,
        method: 'get',
    });
}

/**
 * 获取租户安装的认证客户端
 * @param params
 */
export function buildTenantOauthClient(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/oauthClient`,
        method: 'get',
    });
}


/**
 * 获取租户安装的认证客户端
 * @param params
 */
export function buildTenantDatabases(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/databases`,
        method: 'get',
    });
}

/**
 * 获取租户安装的参数
 * @param params
 */
export function buildTenantParams(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/params`,
        method: 'get',
    });
}

/**
 * 获取租户安装的字典
 * @param params
 */
export function buildTenantDict(tenantId: any) {
    return request({
        url: `/plat/tenantInstall/${tenantId}/dict`,
        method: 'get',
    });
}